package com.nuoniu.sibanyun.entity.erp;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  货币
 * </p>
 *
 * @author baiqiang
 * @since 2020-10-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("fab_currency")
@ApiModel(value="ErpCurrency对象", description="货币")
public class ErpCurrency extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "编号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "币种符号 ")
    @TableField("currency_sign")
    private String currencySign;

    @ApiModelProperty(value = "是否本位币 ")
    @TableField("is_base_currency")
    private Boolean isBaseCurrency;

    @ApiModelProperty(value = "异币种核销允许误差")
    @TableField("max_error")
    private BigDecimal maxError;

    @ApiModelProperty(value = "汇率")
    @TableField("exchange_rate")
    private BigDecimal exchangeRate;

    @ApiModelProperty(value = "汇率设置方式 ")
    @TableField(value = "ex_change_rate_type", updateStrategy = FieldStrategy.IGNORED)
    private Integer exChangeRateType;

    @ApiModelProperty(value = "年度")
    @TableField("account_year")
    private Integer accountYear;

    @ApiModelProperty(value = "状态0:停用1:正常")
    @TableField("status")
    private Boolean status;

    @ApiModelProperty(value = "折算方式 ")
    @TableField(value = "cal_direction", updateStrategy = FieldStrategy.IGNORED)
    private Integer calDirection;

    @ApiModelProperty(value = "制单日期")
    @TableField("made_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate madeDate;

    @ApiModelProperty(value = "修改人id")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField("updated_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate updatedDate;

    @ApiModelProperty(value = "创建人")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate createDate;

    @ApiModelProperty(value = "记账明细列表")
    @TableField(exist = false)
    private List<ErpCurrencyAccount> orderList;
}
